<div class="modal-dialog modal-md">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"  ng-click="closeThisDialog()" style="outline: none;"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">
                <span ng-show="new">新增用户</span>
                <span ng-show="!new">更新用户</span>
            </h4>
        </div>
        <form role="form" ng-submit="submit()">
            <div class="modal-body">
                <div class="form-group">
                    <label for="user-new-username" class="control-label">用户名</label>
                    <input type="text"
                           ng-focus="error.name=''"
                           class="form-control"
                           ng-model="user.name"
                           id="user-new-name"
                           placeholder="用户名">
                    <span ng-show="error.name" class="label label-danger" ng-bind="error.name"></span>
                </div>
                <div class="form-group">
                    <label for="user-new-email"
                           class="control-label">用户邮箱(用于登录)</label>
                    <input type="text"
                           ng-focus="error.email=''"
                           class="form-control"
                           ng-model="user.email"
                           id="user-new-email"
                           ng-disabled="!new"
                           placeholder="用户邮箱(用于登录)">
                    <span ng-show="error.email" class="label label-danger" ng-bind="error.email"></span>
                </div>
                <div class="form-group">
                    <label for="user-new-email"
                           class="control-label">用户类型</label>
                    <select type="text"
                           class="form-control"
                           ng-model="user.type"
                            ng-options="item.id as item.label for item in [{id:0, label:'库存管理员'}, {id:1, label:'系统管理员'}]"
                            disabled>
                    </select>
                    <span ng-show="error.email" class="label label-danger" ng-bind="error.email"></span>
                </div>
                <div class="form-group">
                    <label for="user-new-password" class="control-label">密码</label>
                    <input type="password"
                           ng-focus="error.password=''"
                           class="form-control"
                           ng-model="user.password" id="user-new-password"
                           placeholder="密码">
                    <span ng-show="error.password" class="label label-danger" ng-bind="error.password"></span>
                </div>
                <div class="form-group">
                    <label for="user-new-password_confirmation" class="control-label">重复密码</label>
                    <input type="password"
                           ng-focus="error.password_conformed=''"
                           class="form-control"
                           ng-model="user.password_confirmation"
                           id="user-new-password_confirmation"
                           placeholder="重复密码">
                    <span ng-show="error.password_confirmation" class="label label-danger" ng-bind="error.password_confirmation"></span>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="closeThisDialog()">关闭</button>
                <button type="submit" ladda="saveLoading" class="btn btn-primary">保存</button>
            </div>
        </form>
    </div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->